<?php
include_once('../bootstrap.php');
$cliente = ($_POST['id'])?Doctrine::getTable('cliente')->find($_POST['id']):new Cliente();
$cliente->cuit = $_POST['cuit'];
$cliente->dni = $_POST['dni'];
$cliente->razon = $_POST['nombre'];
$cliente->save();
$result['id'] = $cliente->id;
$result['cuit'] = $cliente->cuit;
$result['dni'] = $cliente->dni;
$result['razon'] = $cliente->razon;
$result = json_encode($result);
header("Content-type: application/json");
echo($result);
?>